package com.tj.collection.enums;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * 催收标签
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2019/9/10
 * Time: 下午9:09
 */
public enum CollectionStatusEnums {
    DEFAULT(0, "--", "--"),
    PAID(5, "Payment received", "PAID"),                                         // Payment received 已经收到还款
    PTP(6, "Promise to pay", "PTP"),                                           // Promise to pay 承诺还款
    CB(7, "Call back", "CB"),                                             // Call back 打回来
    NR(8, "No response", "NR"),                                             // No response 没有回应
    NC(9, "Switch off/no reachable/not connecting", "NC"),                                             // Switch off/no reachable/not connecting 失联
    RTP(10, "Refuse to pay", "RTP"),                                           // Refuse to pay 拒绝还款
    LM(11, "Left message", "LM"),                                          // Left message 留言
    //    SKIP_REPAY(8, "Breach of promise"),                             //跳票
//    NO_REPAY_MEANING(9, "No repayment of sincerity"),               //无还款诚意
//    FAMILY_REPAY(10, "Family compensation"),                        //家人代偿
//    DIFFICULT_TALK(13, "Negotiation"),                              //谈判
//    DIFFICULT_TRANSMIT(14, "Pass on"),                              //转告
//    DIFFICULT_CHEAT(12, "Suspected fraud"),                         //疑似欺诈
    //还款意向标签
    BE_WILLING(21, "Intentional", "Intentional"),
    UNWILLING(22, "No Intention", "No Intention"),

    //无用
    THE_PHONE_WAS_NOT_CONNECTED(100, "The phone was not connected", "The phone was not connected"),
    PROMISE_TO_PAY(101, "Promise to Pay", "Promise to Pay"),
    REFUSE_TO_PAY(102, "Refuse to Pay", "Refuse to Pay"),
    COULD_BE_DECEPTION(103, "could be deception", "could be deception"),

    //催收标签
    PTP_V2(104, "Promise to pay", "PTP"),
    PAY_LATER_V2(105, "Promised to pay after 2 days", "Pay Later"),
    PAID_V2(106, "Already Paid", "Paid"),
    LM_V2(107, "Left Message", "LM"),
    CB_V2(108, "Call Back", "CB"),
    RTP_V2(109, "Refused to Pay", "RTP"),
    RNR_V2(110, "Ringing No Response", "RNR"),
    SWF_V2(111, "Moble Switched Off", "SWF"),
    WN_V2(112, "Wrong Num", "WN"),
    NC_V2(113, "Num Unavailable or Not Reachable", "NC"),

    //系统打的催收标签
    ACTIVE(114, "Recently Active User", "RAU"),
    OVERDUE_ACTIVE(115, "Overdue AI Mobile Success Active", "OAMSA"),

    //打电话结果
    CALLING_RESULT_1(201, "Promise to pay", "Promise to pay"),
    CALLING_RESULT_2(202, "Ringing No Response", "Ringing No Response"),
    CALLING_RESULT_3(203, "Moble Switched Off", "Moble Switched Off"),
    CALLING_RESULT_4(204, "Wrong Num", "Wrong Num"),
    CALLING_RESULT_5(205, "Num Unavailable or Not Reachable", "Num Unavailable or Not Reachable"),
    CALLING_RESULT_6(206, "Don't know him/her", "Don't know him/her"),
    CALLING_RESULT_7(207, "Will inform him/her", "Will inform him/her"),
    CALLING_RESULT_8(208, "Refuse to inform him/her", "Refuse to inform him/her"),

    //关系
    RELATIONSHIP_RELATIVE(301, "Relative", "Relative"),
    RELATIONSHIP_FRIENDS(302, "Friends", "Friends"),
    RELATIONSHIP_COLLEAGUE(303, "Colleague", "Colleague"),
    RELATIONSHIP_OTHERS(304, "Others", "Others"),
    RELATIONSHIP_UNKNOWN(305, "Unknown", "Unknown"),
    ;

    private Integer type;
    private String desc;
    private String shortDesc;

    CollectionStatusEnums(Integer type, String desc, String shortDesc) {
        this.type = type;
        this.desc = desc;
        this.shortDesc = shortDesc;
    }

    public Integer getType() {
        return type;
    }

    public  CollectionStatusEnums setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public  CollectionStatusEnums setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    private static List<CollectionStatusEnums> collectionStatus = null;

    public static List<CollectionStatusEnums> getCollectionStatusEnums() {
        if (collectionStatus == null) {
            collectionStatus = Lists.newArrayList(PTP_V2, PAY_LATER_V2, PAID_V2, LM_V2, CB_V2, RTP_V2, RNR_V2, SWF_V2, WN_V2, NC_V2);
        }
        return collectionStatus;
    }

    private static List<CollectionStatusEnums> callingResults = null;

    public static List<CollectionStatusEnums> getCollectionCallingResults() {
        if (callingResults == null) {
            callingResults = Lists.newArrayList(CALLING_RESULT_1, CALLING_RESULT_2, CALLING_RESULT_3, CALLING_RESULT_4, CALLING_RESULT_5, CALLING_RESULT_6, CALLING_RESULT_7, CALLING_RESULT_8);
        }
        return callingResults;
    }

    private static List<CollectionStatusEnums> relatives = null;

    public static List<CollectionStatusEnums> getCollectionRelatives() {
        if (relatives == null) {
            relatives = Lists.newArrayList(RELATIONSHIP_RELATIVE, RELATIONSHIP_FRIENDS, RELATIONSHIP_COLLEAGUE, RELATIONSHIP_OTHERS, RELATIONSHIP_UNKNOWN);
        }
        return relatives;
    }

    public static  CollectionStatusEnums getEnum(Integer type) {
        for ( CollectionStatusEnums item :  CollectionStatusEnums.values()) {
            if (item.type.equals(type)) {
                return item;
            }
        }
        return null;
    }

    public static String getDesc(Integer type) {
         CollectionStatusEnums item = getEnum(type);
        return item != null ? item.desc : null;
    }

    public static String getDesc2(Integer type) {
         CollectionStatusEnums item = getEnum(type);
        return item != null ? item.shortDesc : null;
    }


    public String getShortDesc() {
        return shortDesc;
    }

    public void setShortDesc(String shortDesc) {
        this.shortDesc = shortDesc;
    }
}
